/**
 * Created by CodeTlan.
 * User: Ing. Miguel Salas
 * Date: 3/11/12
 * Time: 5:00 PM
 */
Ext.define('CT.view.rol.Grid', {
    extend: 'Ctc.view.EditorGrid',
    alias:"widget.gridrol",
    store:'Roles',
    requires:'Ext.ux.grid.checkcolumn.CheckColumn',
    buildColumns: function(){
        return [
            { xtype: 'rownumberer'},
            { header: 'Rol', dataIndex: 'titulo', flex:1, editor: { maxLength:500, vtype:'textspace', allowBlank: false }},
            { width:40, align:'center', dataIndex: 'activo',  xtype:'checkcolumn', editor: { xtype: 'checkbox', cls: 'x-grid-checkheader-editor' }},
            { width:40, align:'center', renderer:this._renderEliminar, editor:{xtype:'hiddenfield'} }
        ];
    },
    buildTbar:function(){
        return[{
            xtype:'button',
            itemId:'btnPermisos',
            text:'Permisos',
            iconCls:'permisos',
            disabled:true,
            action:'addpermisos'
        }];
    },
    _renderEliminar:function(value){
        return "<img src='img/icons/16/del.png' style='cursor:pointer'>";
    }
});